Skip to content

feat: Add late interaction model training support for retrieval#2283

Draft
rnyak wants to merge 5 commits into
mainfrom
rny/late_interaction_retrieval
Draft

feat: Add late interaction model training support for retrieval#2283
rnyak wants to merge 5 commits into
mainfrom
rny/late_interaction_retrieval

Conversation

@rnyak
Copy link
Copy Markdown
Collaborator

@rnyak rnyak commented May 20, 2026

What does this PR do ?

Updated train_bi_encoder.py to support local ColBERT-style (multi_vector) pooling by adding colbert_scores_and_labels(), which computes MaxSim scores with query and passage attention-mask handling. The train and validation paths now route ColBERT models through this scoring function instead of standard pooled embedding contrastive scoring.

The changes in the MR add support for multi_vector pooling and maxsim scoring with and without distributed in-batch neg training.

The latest commits:

  • Added detach_distributed_inbatch_negatives arg (default True), so distributed in-batch negatives can use the previous efficient detached behavior by default, or preserve remote passage gradients when set to false.

  • Renamed ColBERT-style scoring to multi_vector/MaxSim, kept colbert as a backward-compatible alias, and made distributed MaxSim scoring more memory efficient by scoring one passage slot at a time.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?

@rnyak rnyak requested review from a team, HuiyingLi, adil-a, akoumpa and hemildesai as code owners May 20, 2026 17:18
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 20, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rnyak rnyak self-assigned this May 20, 2026
@rnyak rnyak added the enhancement New feature or request label May 20, 2026
@rnyak rnyak marked this pull request as draft May 20, 2026 17:18
@rnyak
Copy link
Copy Markdown
Collaborator Author

rnyak commented May 20, 2026

/claude review

Signed-off-by: Ronay Ak <ronaya@nvidia.com>
Signed-off-by: Ronay Ak <ronaya@nvidia.com>
Comment thread nemo_automodel/recipes/retrieval/train_bi_encoder.py Outdated
Comment thread nemo_automodel/recipes/retrieval/train_bi_encoder.py Outdated
Comment thread nemo_automodel/components/models/common/inbatch_neg_utils.py
Comment thread nemo_automodel/recipes/retrieval/train_bi_encoder.py Outdated
…egatives

Signed-off-by: Ronay Ak <ronaya@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants